package com.xltt.vehicleControl.bean;

import java.io.Serializable;

/**
 * @Author zhaotengfei
 * @Time 2017/6/27 15:33
 * @Version 1.0.0
 */

public class ElectricVehicleStatus implements Serializable {
    /**充电状态stateOfCharge值属性*/
    public static final int STATUS_DEFAULT = 0;             //默认值
    public static final int STATUS_CHARGING = 1;            //正在充电
    public static final int STATUS_CHARGE_COMPLETE = 2;     //充满电结束
    public static final int STATUS_CHARGE_FAULT = 3;        //充电故障
    public static final int STATUS_HEATING = 4;             //正在加热
    public static final int STATUS_FAIL_SILENT = 5;         //充电暂停
    public static final int STATUS_WAITING = 6;             //预约充电等待

    /**
     * 充电预约状态chargeSts值属性
     */
    public static final int STATUS_NOT_APPOINT = 0;         //无预约（未预约/预约充电失败）
    public static final int STATUS_APPOINTING = 1;          //预约等待中（已预约）
    public static final int STATUS_APPOINT_FINISH = 2;      //预约充电中（预约充电成功）

    public static final int NON_CONNECT = 0;//外部电源状态
    public static final int LOCK_UP_STATE_FAUILUER = 1;//外部电源状态
    public static final int POW_AVAILABLE_NOT_ACTIVE = 2;//外部电源状态
    public static final int CONNECT_AND_POWER = 3;//外部电源状态
    public static final int CP_SIGNAL_FAUILURE = 7;//外部电源状态

    private boolean isCharging;                     //是否正在充电
    private boolean isPluggedIn;                    //是否插入充电桩
    private Integer stateOfCharge;                  //预约充电-状态
    private Float chargeLevel;                      //当前电量百分比
    private Integer timeToFullyCharged;             //充满电所需时间（单位分钟）
    private Integer statusOfChargerConnection;      //交流充电枪连接状态
    private Integer chargerState;                   //预约充电状态
    private Integer chargeSts;                      //预约充电-状态（1.0）0:无预约1:预约中2:预约充电中
    private Integer bookChargeSts;                  //v2预约充电的充电状态（2.0）0:默认1:充电成功2:充电失败3:充电完成
    private Integer distanceToEmptyOnBatteryOnly;   //电池续航距离
    private Integer ems48VSOC;
    private Integer emsHVRBSError;
    private Integer emsRBSModeDisplay;
    private Integer emsOVPActive;
    private Integer ems48vPackTemp1;
    private Integer ems48vPackTemp2;
    private Integer emsBMSLBuildSwVersion;
    private Integer emsCBRemainingLife;
    private Float averPowerConsumption;//平均百公里能耗


	//以下均为v2新添
    /**
     * 充电枪状态statusOfChargerConnection值属性
     */
    public static final int CHARGER_CONNECTION_STATUS_DISCONNECTED = 0;  //未连接
    //    瞬时电耗
    private String indPowerConsumption;
    //    直流转直流控制器
    private String dcDcActvd;
    //    SOC 值（是显示给用户的SOC，可以显示100%）
    private String ems48VDisSOC;
    //    直流充电电流
    private String dcChargeIAct;
    //    交流充电电流
    private String chargeIAct;
    //    交流充电电压
    private String chargeUAct;
    //    无线充电有无障碍物状态显示
    private String wptObjt;
    //    无线充电整车对准状态
    private String wptFineAlignt;
    //    无线充电开关
    private String wptActived;
    //    无线充电电流
    private String wptChargeIAct;
    //    无线充电电压
    private String wptChargeUAct;
    //    无线充电状态
    private String wptChargeSts;
    //    直流充电枪连接状态
    private String dcDcConnectStatus;
    //    直流充电状态
    private String dcChargeSts;
    //    放电连接状态
    private String disChargeConnectStatus;
    //    放电电流
    private String disChargeIAct;
    //    放电电压
    private String disChargeUAct;
    //    放电状态
    private String disChargeSts;

    //充电口盖状态(0:未知1:开2:关)
    private String chargeLidStatus;
    //前面充电盖状态
    private String chargeLidFrontStatus;
    //后面充电盖状态
    private String chargeLidRearStatus;

    //放电剩余时间 单位：分钟
    private String timeToTargetDisCharged;

    //AC充电盖状态
    private String chargeLidAcStatus;

    //DC 或 AC/DC充电盖状态
    private String chargeLidDcAcStatus;

    public ElectricVehicleStatus() {
    }

    public boolean isIsCharging() {
        return this.isCharging;
    }

    public void setIsCharging(boolean isCharging) {
        this.isCharging = isCharging;
    }

    public boolean isIsPluggedIn() {
        return this.isPluggedIn;
    }

    public void setIsPluggedIn(boolean isPluggedIn) {
        this.isPluggedIn = isPluggedIn;
    }

    public Integer getStateOfCharge() {
        if ((chargeSts != null && chargeSts == STATUS_APPOINTING)
                && (stateOfCharge != null && stateOfCharge == STATUS_DEFAULT)) {
            this.stateOfCharge = STATUS_WAITING;
        }
        return this.stateOfCharge;
    }

    public void setStateOfCharge(Integer stateOfCharge) {
        this.stateOfCharge = stateOfCharge;
    }

    public Integer getChargeLevel() {
        return chargeLevel != null ? (int)chargeLevel.floatValue() : null;
    }

    public void setChargeLevel(Float chargeLevel) {
        this.chargeLevel = chargeLevel;
    }

    public Integer getTimeToFullyCharged() {
        return this.timeToFullyCharged;
    }

    public boolean isCharging() {
        return isCharging;
    }

    public void setCharging(boolean charging) {
        isCharging = charging;
    }

    public boolean isPluggedIn() {
        return isPluggedIn;
    }

    public void setPluggedIn(boolean pluggedIn) {
        isPluggedIn = pluggedIn;
    }

    public Integer getStatusOfChargerConnection() {
        return statusOfChargerConnection;
    }

    public void setStatusOfChargerConnection(Integer statusOfChargerConnection) {
        this.statusOfChargerConnection = statusOfChargerConnection;
    }

    public Integer getChargerState() {
        return chargerState;
    }

    public void setChargerState(Integer chargerState) {
        this.chargerState = chargerState;
    }
    public Integer getBookChargeSts() {
        return bookChargeSts;
    }

    public void setBookChargeSts(Integer bookChargeSts) {
        this.bookChargeSts = bookChargeSts;
    }

    public Integer getDistanceToEmptyOnBatteryOnly() {
        return distanceToEmptyOnBatteryOnly;
    }

    public void setDistanceToEmptyOnBatteryOnly(Integer distanceToEmptyOnBatteryOnly) {
        this.distanceToEmptyOnBatteryOnly = distanceToEmptyOnBatteryOnly;
    }

    public Integer getEms48VSOC() {
        return ems48VSOC;
    }

    public void setEms48VSOC(Integer ems48VSOC) {
        this.ems48VSOC = ems48VSOC;
    }

    public Integer getEmsHVRBSError() {
        return emsHVRBSError;
    }

    public void setEmsHVRBSError(Integer emsHVRBSError) {
        this.emsHVRBSError = emsHVRBSError;
    }

    public Integer getEmsRBSModeDisplay() {
        return emsRBSModeDisplay;
    }

    public void setEmsRBSModeDisplay(Integer emsRBSModeDisplay) {
        this.emsRBSModeDisplay = emsRBSModeDisplay;
    }

    public Integer getEmsOVPActive() {
        return emsOVPActive;
    }

    public void setEmsOVPActive(Integer emsOVPActive) {
        this.emsOVPActive = emsOVPActive;
    }

    public Integer getEms48vPackTemp1() {
        return ems48vPackTemp1;
    }

    public void setEms48vPackTemp1(Integer ems48vPackTemp1) {
        this.ems48vPackTemp1 = ems48vPackTemp1;
    }

    public Integer getEms48vPackTemp2() {
        return ems48vPackTemp2;
    }

    public void setEms48vPackTemp2(Integer ems48vPackTemp2) {
        this.ems48vPackTemp2 = ems48vPackTemp2;
    }

    public Integer getEmsBMSLBuildSwVersion() {
        return emsBMSLBuildSwVersion;
    }

    public void setEmsBMSLBuildSwVersion(Integer emsBMSLBuildSwVersion) {
        this.emsBMSLBuildSwVersion = emsBMSLBuildSwVersion;
    }

    public Integer getEmsCBRemainingLife() {
        return emsCBRemainingLife;
    }

    public void setEmsCBRemainingLife(Integer emsCBRemainingLife) {
        this.emsCBRemainingLife = emsCBRemainingLife;
    }

    public void setTimeToFullyCharged(Integer timeToFullyCharged) {
        this.timeToFullyCharged = timeToFullyCharged;
    }

    public Integer getChargeSts() {
        return chargeSts;
    }

    public void setChargeSts(Integer chargeSts) {
        this.chargeSts = chargeSts;
    }

    public static boolean isNormal(Integer status) {
        return status == null || status.intValue() != 1 && status.intValue() != 6;
    }

    public Float getAverPowerConsumption() {
        return averPowerConsumption;
    }

    public void setAverPowerConsumption(Float averPowerConsumption) {
        this.averPowerConsumption = averPowerConsumption;
    }

    public String getIndPowerConsumption() {
        return indPowerConsumption;
    }

    public void setIndPowerConsumption(String indPowerConsumption) {
        this.indPowerConsumption = indPowerConsumption;
    }

    public String getDcDcActvd() {
        return dcDcActvd;
    }

    public void setDcDcActvd(String dcDcActvd) {
        this.dcDcActvd = dcDcActvd;
    }

    public String getEms48VDisSOC() {
        return ems48VDisSOC;
    }

    public void setEms48VDisSOC(String ems48VDisSOC) {
        this.ems48VDisSOC = ems48VDisSOC;
    }

    public String getDcChargeIAct() {
        return dcChargeIAct;
    }

    public void setDcChargeIAct(String dcChargeIAct) {
        this.dcChargeIAct = dcChargeIAct;
    }

    public String getChargeIAct() {
        return chargeIAct;
    }

    public void setChargeIAct(String chargeIAct) {
        this.chargeIAct = chargeIAct;
    }

    public String getChargeUAct() {
        return chargeUAct;
    }

    public void setChargeUAct(String chargeUAct) {
        this.chargeUAct = chargeUAct;
    }

    public String getWptObjt() {
        return wptObjt;
    }

    public void setWptObjt(String wptObjt) {
        this.wptObjt = wptObjt;
    }

    public String getWptFineAlignt() {
        return wptFineAlignt;
    }

    public void setWptFineAlignt(String wptFineAlignt) {
        this.wptFineAlignt = wptFineAlignt;
    }

    public String getWptActived() {
        return wptActived;
    }

    public void setWptActived(String wptActived) {
        this.wptActived = wptActived;
    }

    public String getWptChargeIAct() {
        return wptChargeIAct;
    }

    public void setWptChargeIAct(String wptChargeIAct) {
        this.wptChargeIAct = wptChargeIAct;
    }

    public String getWptChargeUAct() {
        return wptChargeUAct;
    }

    public void setWptChargeUAct(String wptChargeUAct) {
        this.wptChargeUAct = wptChargeUAct;
    }

    public String getWptChargeSts() {
        return wptChargeSts;
    }

    public void setWptChargeSts(String wptChargeSts) {
        this.wptChargeSts = wptChargeSts;
    }

    public String getDcDcConnectStatus() {
        return dcDcConnectStatus;
    }

    public void setDcDcConnectStatus(String dcDcConnectStatus) {
        this.dcDcConnectStatus = dcDcConnectStatus;
    }

    public String getDcChargeSts() {
        return dcChargeSts;
    }

    public void setDcChargeSts(String dcChargeSts) {
        this.dcChargeSts = dcChargeSts;
    }

    public String getDisChargeConnectStatus() {
        return disChargeConnectStatus;
    }

    public void setDisChargeConnectStatus(String disChargeConnectStatus) {
        this.disChargeConnectStatus = disChargeConnectStatus;
    }

    public String getDisChargeIAct() {
        return disChargeIAct;
    }

    public void setDisChargeIAct(String disChargeIAct) {
        this.disChargeIAct = disChargeIAct;
    }

    public String getDisChargeUAct() {
        return disChargeUAct;
    }

    public void setDisChargeUAct(String disChargeUAct) {
        this.disChargeUAct = disChargeUAct;
    }

    public String getDisChargeSts() {
        return disChargeSts;
    }

    public void setDisChargeSts(String disChargeSts) {
        this.disChargeSts = disChargeSts;
    }

    public String getChargeLidStatus() {
        return chargeLidStatus;
    }

    public void setChargeLidStatus(String chargeLidStatus) {
        this.chargeLidStatus = chargeLidStatus;
    }

    public String getChargeLidFrontStatus() {
        return chargeLidFrontStatus;
    }

    public void setChargeLidFrontStatus(String chargeLidFrontStatus) {
        this.chargeLidFrontStatus = chargeLidFrontStatus;
    }

    public String getChargeLidRearStatus() {
        return chargeLidRearStatus;
    }

    public void setChargeLidRearStatus(String chargeLidRearStatus) {
        this.chargeLidRearStatus = chargeLidRearStatus;
    }

    public String getTimeToTargetDisCharged() {
        return timeToTargetDisCharged;
    }

    public void setTimeToTargetDisCharged(String timeToTargetDisCharged) {
        this.timeToTargetDisCharged = timeToTargetDisCharged;
    }

    public String getChargeLidAcStatus() {
        return chargeLidAcStatus;
    }

    public void setAcChargeLidStatus(String acChargeLidStatus) {
        this.chargeLidAcStatus = acChargeLidStatus;
    }

    public String getChargeLidDcAcStatus() {
        return chargeLidDcAcStatus;
    }

    public void setDcOrAcDcChargeLidStatus(String dcOrAcDcChargeLidStatus) {
        this.chargeLidDcAcStatus = dcOrAcDcChargeLidStatus;
    }


    @Override
    public String toString() {
        return "ElectricVehicleStatus{" +
                "isCharging=" + isCharging +
                ", isPluggedIn=" + isPluggedIn +
                ", stateOfCharge=" + stateOfCharge +
                ", chargeLevel=" + chargeLevel +
                ", timeToFullyCharged=" + timeToFullyCharged +
                ", statusOfChargerConnection=" + statusOfChargerConnection +
                ", chargerState=" + chargerState +
                ", chargeSts=" + chargeSts +
                ", bookChargeSts=" + bookChargeSts +
                ", distanceToEmptyOnBatteryOnly=" + distanceToEmptyOnBatteryOnly +
                ", ems48VSOC=" + ems48VSOC +
                ", emsHVRBSError=" + emsHVRBSError +
                ", emsRBSModeDisplay=" + emsRBSModeDisplay +
                ", emsOVPActive=" + emsOVPActive +
                ", ems48vPackTemp1=" + ems48vPackTemp1 +
                ", ems48vPackTemp2=" + ems48vPackTemp2 +
                ", emsBMSLBuildSwVersion=" + emsBMSLBuildSwVersion +
                ", emsCBRemainingLife=" + emsCBRemainingLife +
                ", averPowerConsumption=" + averPowerConsumption +
                ", indPowerConsumption='" + indPowerConsumption + '\'' +
                ", dcDcActvd='" + dcDcActvd + '\'' +
                ", ems48VDisSOC='" + ems48VDisSOC + '\'' +
                ", dcChargeIAct='" + dcChargeIAct + '\'' +
                ", chargeIAct='" + chargeIAct + '\'' +
                ", chargeUAct='" + chargeUAct + '\'' +
                ", wptObjt='" + wptObjt + '\'' +
                ", wptFineAlignt='" + wptFineAlignt + '\'' +
                ", wptActived='" + wptActived + '\'' +
                ", wptChargeIAct='" + wptChargeIAct + '\'' +
                ", wptChargeUAct='" + wptChargeUAct + '\'' +
                ", wptChargeSts='" + wptChargeSts + '\'' +
                ", dcDcConnectStatus='" + dcDcConnectStatus + '\'' +
                ", dcChargeSts='" + dcChargeSts + '\'' +
                ", disChargeConnectStatus='" + disChargeConnectStatus + '\'' +
                ", disChargeIAct='" + disChargeIAct + '\'' +
                ", disChargeUAct='" + disChargeUAct + '\'' +
                ", disChargeSts='" + disChargeSts + '\'' +
                ", chargeLidStatus='" + chargeLidStatus + '\'' +
                ", chargeLidFrontStatus='" + chargeLidFrontStatus + '\'' +
                ", chargeLidRearStatus='" + chargeLidRearStatus + '\'' +
                ", timeToTargetDisCharged='" + timeToTargetDisCharged + '\'' +
                '}';
    }
}
